#ifndef ROSYNCCREATION_H
#define ROSYNCCREATION_H

#include "ROSyncObject.h"

class RONodePrivate;
//用于处理同步创建对象这一问题的
class ROSyncCreation:public ROSyncObject
{
    Q_OBJECT
    QML_NAMED_ELEMENT(ROSyncCreation)
public:
    ROSyncCreation(QObject* parent = nullptr);

protected:
    void initialize() override;
    virtual QObject* handleCreation(const QStringList& reason) = 0;
    //注册该对象，使得客户端自动创建该对象的拷贝
    void registerObject(QObject* obj,const QStringList& reason);
    //注册该对象，该对象仅在本端存在 不会创建拷贝
    void registerObjectIndividual(QObject* obj);
    QObject* getObjectById(int id);
private:



    friend class RONodePrivate;
};

#endif
